package com.xcf.service.business.finance.impl;

import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.xcf.dao.DaoSupport;
import com.xcf.service.business.finance.FreightIncomeService;
import com.xcf.util.PageData;
@Service("FreightIncomeServiceImpl")
public class FreightIncomeServiceImpl  implements FreightIncomeService{
	@Resource(name = "daoSupport")
	private DaoSupport daosupport;

	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> serh(PageData pd) throws Exception {
		
		return (List<PageData>) daosupport.findForList("income.serh", pd);
	}

	@SuppressWarnings("unchecked")
	public List<PageData> serhye(PageData pd) throws Exception {
		
		return (List<PageData>) daosupport.findForList("income.serhye", pd);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> serhdi(PageData pd) throws Exception {
		
		 return (List<PageData>) daosupport.findForList("income.serhdi", pd);
	}

	@Override
	public void save(PageData pdq) throws Exception {
		 daosupport.save("income.save", pdq);
		
	}

	//查询
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> search(PageData pd) throws Exception {
		
		return (List<PageData>) daosupport.findForList("income.search", pd);
	}

	@Override
	public List<PageData> sear(PageData pd) throws Exception {
		return (List<PageData>) daosupport.findForList("income.sear", pd);
	}

	//修改
	@Override
	public void updit(PageData pdq) throws Exception {
		daosupport.update("income.updit", pdq);
		
	}

	//删除
	@Override
	public void dele(PageData pd) throws Exception {
		daosupport.delete("income.dele", pd);
		
	}

	//查询部门
	@SuppressWarnings("unchecked")
	@Override
	public List<PageData> serhbumen(PageData pd) throws Exception {
	
		return (List<PageData>) daosupport.findForList("income.serhbumen", pd);
	}

	//运费收入显示
	@Override
	public List<PageData> seach(PageData pd) throws Exception {
		
		return (List<PageData>) daosupport.findForList("income.seach", pd);
	}

	@Override
	public PageData findFeeAmount(PageData pd) throws Exception {
		// TODO Auto-generated method stub
		return (PageData) daosupport.findForObject("income.findFeeAmount", pd);
	}

	@Override
	public PageData findFrontAmount(String invoice_bill_code) throws Exception {
		// TODO Auto-generated method stub
		return (PageData) daosupport.findForObject("income.findFrontAmount", invoice_bill_code);
	}

	@Override
	public PageData findInvoiceAllAmount(PageData pd) throws Exception {
		// TODO Auto-generated method stub
		return (PageData) daosupport.findForObject("income.findInvoiceAllAmount", pd);
	}

	@Override
	public PageData findFrontInvoiceAmount(String receivables_invoice_code) throws Exception {
		// TODO Auto-generated method stub
		return (PageData) daosupport.findForObject("income.findFrontInvoiceAmount", receivables_invoice_code);
	}

	@Override
	public void saveReceivablesCotsDetail(PageData pd) throws Exception {
		daosupport.save("income.saveReceivablesCotsDetail", pd);
		
	}

	@Override
	public void saveReceivablesDeductibleDetail(PageData pd) throws Exception {
		daosupport.save("income.saveReceivablesDeductibleDetail", pd);
		
	}
	public Object getPaymentCode(PageData pd) throws Exception {
		// TODO Auto-generated method stub
		daosupport.findForObject("income.getPaymentCode", pd);
		return ((Map<String,Object>)pd.get("pd")).get("paymentCode");
	}

	@Override
	public void saveReceivablesCostInfo(PageData pd) throws Exception {
		daosupport.save("income.saveReceivablesCostInfo", pd);
		
	}

	@Override
	public List<Map> findReceivablesInfo(PageData pd) throws Exception {
		
		return (List<Map>) daosupport.findForList("income.findReceivablesCostInfo", pd);
	}

	@Override
	public void updateReceivablesCotsDetail(PageData pd) throws Exception {
		daosupport.update("income.updateReceivablesCotsDetail", pd);
		
	}

	@Override
	public void updateReceivablesDeductibleDetail(PageData pd) throws Exception {
		daosupport.update("income.updateReceivablesDeductibleDetail", pd);
		
	}

	@Override
	public void updateReceivablesCostInfo(PageData pd) throws Exception {
		daosupport.update("income.updateReceivablesCostInfo", pd);
		
	}

}
